#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include "LinkedList.h"

int main(void) {
	LinkedList list; // 
	linkedlist_init(&list);

	//add_before_head(&list, 1);
	//add_before_head(&list, 2);
	//add_before_head(&list, 3);
	//add_before_head(&list, 4);	// 4->3->2->1

	add_behind_tail(&list, 1);
	add_behind_tail(&list, 2);
	add_behind_tail(&list, 3);
	add_behind_tail(&list, 4);	
	add_behind_tail(&list, 5);	

	//add_by_index(&list, 0, 1);
	//add_by_index(&list, 0, 2);
	//add_by_index(&list, 2, 3);
	//add_by_index(&list, 1, 4);		// 2->4->1->3

	// Node* node1 = search_by_value(&list, 4);
	// Node* node2 = search_by_value(&list, 9);

	// linkedlist_display(&list);

	delete_by_value(&list, 1);
	delete_by_value(&list, 9);
	delete_by_value(&list, 4);
	delete_by_value(&list, 5);  // 2->3->NULL

	linkedlist_destroy(&list);
	return 0;
}